import mesch
import logging

logger = logging.getLogger()

N = 5

f = open('contacts1.txt')
o = open('out.txt','w')
log = open('log.log','w')
A = mesch(N, N, 1)

def init_relation():
    """i(row)->j(col)"""
    for i in f:
        j = i[:-1].split(',')
        A.set(int(j[0]), int(j[1]), 1)

def calc():
